package org.softmed.rest.generation;

import java.util.HashMap;
import java.util.Map;

import com.google.inject.Inject;
import com.google.inject.name.Named;

public class ModuleBuilderManager {

	@Inject
	@Named("DefaultModuleBuilder")
	static RESTModuleBuilder defaultModuleBuilder;

	static Map<String, RESTModuleBuilder> builders = new HashMap<String, RESTModuleBuilder>();

	public static void clear() {
		builders.clear();
	}

	public static void register(String name, RESTModuleBuilder suite) {
		builders.put(name, suite);
	}

	public static RESTModuleBuilder getBuilder(String name) {
		return builders.get(name);
	}

	public static Map<String, RESTModuleBuilder> getBuildersByName() {
		return builders;
	}

	public static RESTModuleBuilder getDefaultModuleBuilder() {
		return defaultModuleBuilder;
	}

	public static void setDefaultModuleBuilder(
			RESTModuleBuilder defaultModuleBuilder) {
		ModuleBuilderManager.defaultModuleBuilder = defaultModuleBuilder;
	}

}
